package com.example.human_resource_management.common;

public enum ResponseCode {
    SUCCESS(0, "SUCCESS", "请求成功"),
    FAILURE(-1, "FAILURE", "请求失败"),
    PARAM_ERR(-2, "param error", "参数错误"),
    AUTH_ERR(-3, "authentication error", "认证错误"),
    REMOTE_ERR(-4, "remote error", "远程调用错误"),
    METHOD_ERR(-5, "method not support", "请求方法不支持"),
    NOT_FOUND_ERR(-6, "not found", "未找到路径"),
    PERMISSION_ERR(-7, "permission error", "权限错误"),
    SERVER_ERR(-10, "server error", "服务器错误"),
    UNKNOWN_ERR(-100, "unknown", "未知错误"),
    WARN(1, "warning", "警告");

    private Integer code;
    private String msg;
    private String desc;

    private ResponseCode(Integer code, String msg, String desc) {
        this.code = code;
        this.msg = msg;
        this.desc = desc;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public String getDesc() {
        return this.desc;
    }

    public String toString() {
        return "ResponseCode." + this.name() + "(code=" + this.getCode() + ", msg=" + this.getMsg() + ", desc=" + this.getDesc() + ")";
    }
}